package com.lms.service.impl;

import com.lms.mapper.GreenschoolbaseinfoMapper;
import com.lms.service.GreenschoolbaseinfoService;
import com.lms.vo.GreenschoolbaseinfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 绿色校园基础数据业务逻辑层接口实现类
 * @author: L-B-S
 * @Date: 2021/3/7 16:56
 * @modified_By:
 * @Version: 0.0$
 */
@Service
public class GreenschoolbaseinfoServiceImpl implements GreenschoolbaseinfoService {

    @Autowired
    private GreenschoolbaseinfoMapper greenschoolbaseinfoMapper;

    @Override
    public GreenschoolbaseinfoVo gsbiList() {
        GreenschoolbaseinfoVo greenschoolbaseinfoVo = new GreenschoolbaseinfoVo();

        List<String> locations = greenschoolbaseinfoMapper.selectLocations();
        locations.add(0, "草堂校区");
        greenschoolbaseinfoVo.setLocations(locations);

        List<Object> greenCoverRatios = greenschoolbaseinfoMapper.selectGreenCoverRatios();
        greenCoverRatios.add(0, "绿化覆盖率(%)");
        greenschoolbaseinfoVo.setGreenCoverRatios(greenCoverRatios);

        List<Object> greenRatios = greenschoolbaseinfoMapper.selectGreenRatios();
        greenRatios.add(0, "绿地率(%)");
        greenschoolbaseinfoVo.setGreenRatios(greenRatios);

        List<Object> plotRatios = greenschoolbaseinfoMapper.selectPlotRatios();
        plotRatios.add(0, "容积率(%)");
        greenschoolbaseinfoVo.setPlotRatios(plotRatios);

        return greenschoolbaseinfoVo;
    }
}
